package com.oig.auth.api.factory;

import com.oig.auth.api.OAuthLoginService;
import com.oig.auth.api.fallback.OAuthLoginFallbackImpl;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class OAuthLoginFallbackFactory implements FallbackFactory<OAuthLoginService> {

    @Override
    public OAuthLoginService create(Throwable cause) {
        OAuthLoginFallbackImpl oAuthLoginServiceFallback = new OAuthLoginFallbackImpl();
        oAuthLoginServiceFallback.setCause(cause);
        return oAuthLoginServiceFallback;
    }

}
